package org.com.suit.dao;

import java.util.ArrayList;
import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.com.suit.dao.impl.WritingDaoImpl;
import org.com.suit.domain.Writing;
import org.com.suit.mapper.WritingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class WritingDao implements WritingDaoImpl{
	
	@Autowired
	SqlSession sqlSession;
	
	/* メッセージSEND */
	public void writingText(Writing writing) {
		
		WritingMapper mapper = sqlSession.getMapper(WritingMapper.class);
		mapper.writingText(writing);
				
	}
	
	/* All Contents 読み込み */
	public List<Writing> getWritingLists(Integer no) {
		List<Writing> list = new ArrayList<Writing>();
		
		WritingMapper mapper = sqlSession.getMapper(WritingMapper.class);
		list = mapper.selectAllContents(no);
		
		return list;
	}

	
}
